package com.shujia.base;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;

public class PutData {
    public static void main(String[] args) throws Exception{
        BufferedReader br = new BufferedReader(new FileReader("/usr/local/soft/bigdata29/jdgoods.csv"));
        BufferedWriter bw = new BufferedWriter(new FileWriter("/usr/local/soft/bigdata29/jd_goods.txt"));

        String line = null;
        int num = 0;
        while ((line=br.readLine())!=null){

            bw.write(line);
            bw.flush();
            num++;
            System.out.println("-----------------模拟实时数据产生第 "+num+" 条-----------------------");
            if(num==90){
                break;
            }else {
                bw.newLine();
            }

            Thread.sleep(1000);
        }

        bw.close();
        br.close();
    }
}
